/*
 * Powered By [rapid-framework]
 * Web Site: http://www.rapid-framework.org.cn
 * Google Code: http://code.google.com/p/rapid-framework/
 * Since 2008 - 2011
 */

package com.nail.zhaogr.model;

import javax.persistence.*;

import org.hibernate.annotations.GenericGenerator;

import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import java.util.*;

import javacommon.base.*;
import javacommon.util.*;

import cn.org.rapid_framework.util.*;
import cn.org.rapid_framework.web.util.*;
import cn.org.rapid_framework.page.*;
import cn.org.rapid_framework.page.impl.*;

import com.nail.zhaogr.model.*;
import com.nail.zhaogr.dao.*;
import com.nail.zhaogr.service.*;
import com.nail.zhaogr.vo.query.*;

/**
 * @author badqiu email:badqiu(a)gmail.com
 * @version 1.0
 * @since 1.0
 */


@Entity
@Table(name = "links")
public class Links extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "Links";
	public static final String ALIAS_LINK_ID = "linkId";
	public static final String ALIAS_LINK_URL = "linkUrl";
	public static final String ALIAS_LINK_NAME = "linkName";
	public static final String ALIAS_STATUS = "status";
	public static final String ALIAS_SORT_INDEX = "sortIndex";
	
	//date formats
	

	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
    /**
     * linkId       db_column: linkId 
     */ 	
	
	private java.lang.Long linkId;
    /**
     * linkUrl       db_column: linkUrl 
     */ 	
	@NotBlank @Length(max=255)
	private java.lang.String linkUrl;
    /**
     * linkName       db_column: linkName 
     */ 	
	@NotBlank @Length(max=50)
	private java.lang.String linkName;
    /**
     * status       db_column: status 
     */ 	
	
	private java.lang.Integer status;
    /**
     * sortIndex       db_column: sortIndex 
     */ 	
	
	private java.lang.Integer sortIndex;
	//columns END


	public Links(){
	}

	public Links(
		java.lang.Long linkId
	){
		this.linkId = linkId;
	}

	

	public void setLinkId(java.lang.Long value) {
		this.linkId = value;
	}
	
	@Id @GeneratedValue(generator="custom-id")
	@GenericGenerator(name="custom-id", strategy = "increment")
	@Column(name = "linkId", unique = true, nullable = false, insertable = true, updatable = true, length = 19)
	public java.lang.Long getLinkId() {
		return this.linkId;
	}
	
	@Column(name = "linkUrl", unique = false, nullable = false, insertable = true, updatable = true, length = 255)
	public java.lang.String getLinkUrl() {
		return this.linkUrl;
	}
	
	public void setLinkUrl(java.lang.String value) {
		this.linkUrl = value;
	}
	
	@Column(name = "linkName", unique = false, nullable = false, insertable = true, updatable = true, length = 50)
	public java.lang.String getLinkName() {
		return this.linkName;
	}
	
	public void setLinkName(java.lang.String value) {
		this.linkName = value;
	}
	
	@Column(name = "status", unique = false, nullable = true, insertable = true, updatable = true, length = 10)
	public java.lang.Integer getStatus() {
		return this.status;
	}
	
	public void setStatus(java.lang.Integer value) {
		this.status = value;
	}
	
	@Column(name = "sortIndex", unique = false, nullable = true, insertable = true, updatable = true, length = 10)
	public java.lang.Integer getSortIndex() {
		return this.sortIndex;
	}
	
	public void setSortIndex(java.lang.Integer value) {
		this.sortIndex = value;
	}
	

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("LinkId",getLinkId())
			.append("LinkUrl",getLinkUrl())
			.append("LinkName",getLinkName())
			.append("Status",getStatus())
			.append("SortIndex",getSortIndex())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getLinkId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof Links == false) return false;
		if(this == obj) return true;
		Links other = (Links)obj;
		return new EqualsBuilder()
			.append(getLinkId(),other.getLinkId())
			.isEquals();
	}
}

